package zero.tech.games.dn.event;

import zero.tech.core.event.EventListener;
import zero.tech.core.event.EventType;
import zero.tech.games.dn.data.DnRoomStatus;
import zero.tech.games.dn.data.DnTimer;
import zero.tech.games.logic.common.Room;
import zero.tech.games.logic.data.LogicEventType;

public class RoomDissolutionRuntimer implements EventListener{

	@Override
	public EventType netEventType() {
		return LogicEventType.ROOM_DISSOLUTION_RUNTIMER;
	}

	@Override
	public void notifyEvent(Object... objs) {
		Room room = (Room) objs[0];
		long pass=(long) objs[1];
		int room_status=room.getRoom_status();
		DnTimer dnTimer=(DnTimer) room.getTimer();
		if(room_status==DnRoomStatus.QIANGZHUANG) {
			dnTimer.lastBeginQiangzhuangTimer+=pass;
		}else if(room_status==DnRoomStatus.YAZHU) {
			dnTimer.lastBeginYazhuTimer+=pass;
		}else if(room_status==DnRoomStatus.LIANGPAI) {
			dnTimer.lastBeginLiangpaiTimer+=pass;
		}else if(room_status==DnRoomStatus.WAIT_NEXT_ROUND) {
			dnTimer.lastBeginToReadyTime+=pass;
		}
	}

	@Override
	public boolean asynchronous() {
		return false;
	}

}
